/*
 * Window.h
 * Engine related stuff goes here, like initialization, level loading,
 * blitting images, cleaning up, etc.
 *
 *  Created on: 09.06.2010
 *      Author: Simon Dehne
 */

#include <string>

#include "SDL/SDL.h"
#include "SDL/SDL_ttf.h"
//#include "GUI.h"
class GUI;

class Window {

public:
	// Constructor
	Window();

	// Initialization and loading functions
	bool init();
	bool load();
	bool loadLevel(std::string levelNr);

	// TODO: Move to GUI class
	void refreshGUI();

	// Cleanup for program exit
	void cleanUp();

	// Custom flip function
	void flipScreen();

	// Image loading function
	SDL_Surface *load_image(std::string filename);

	// Blitting function
	void apply_surface(int x, int y, SDL_Surface* source, SDL_Surface* destination, SDL_Rect* clip);

	// Getter for the GUI
	GUI& getGUI();

private:

	// The screen
	SDL_Surface *screen;
	// The screen background
	SDL_Surface *background;

	// The block sprite-sheet
	SDL_Surface *blocks;

	// Array containing the offsets and dimensions of the blocks
	SDL_Rect clip[7];

	// TODO: Move these into the GUI class
	// The "Score" label
	SDL_Surface *scoreLabel;
	// The actual display of the current score
	SDL_Surface *scoreDisplay;

	// Background for the GUI
	SDL_Rect guiBG;

	// Event structure to handle button presses etc.
	SDL_Event event;

	// Font for onscreen messages
	TTF_Font *font;

};


